<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        div {
            width: 1150px;
            height: 400px;
            margin: 50px auto;
            border: 1px solid red;
            overflow: hidden;
        }
        li {
            width: 240px;
            height: 400px;
            float: left;
        }
        ul {
            list-style: none;
            width: 1300px;
        }
    </style>
</head>
<body>
<div>
    <ul>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>
<script src="../animate.js"></script>
<script>
    window.onload = function () {
        var div = document.getElementsByTagName('div')[0];
        var lis = document.getElementsByTagName('li');
        for(var i =0;i<lis.length;i++){
            console.log(i);
            lis[i].style.background = 'url(images/'+(i+1)+'.jpg) no-repeat';
            lis[i].onmouseover = function () {
                for(var j =0;j<lis.length;j++){
                    animate(lis[j],{'width':100})
                }
                animate(this,{'width':800})

            }
        }
        div.onmouseout = function () {
            for(var j=0;j<lis.length;j++){
                animate(lis[j],{'width':240});
            }
        }
    }
</script>
</body>
</html>